/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lcfgly.Cache;

import com.lcfgly.Interface.ICache;
import org.apache.log4j.Logger;

/**
 *
 * @author lcfgly
 */
public class UpdateThread extends Thread{
    
    private final String[] keys;
    private final ICache cache;

    public UpdateThread(String[] keys, ICache cache) {
        this.keys = keys;
        this.cache = cache;
    }
    
    @Override
    public void run() {
        for (String string : keys) {
            if(cache.remove(string))
                Logger.getLogger("Memcache").info("更新删除缓存:"+string);
            else
                Logger.getLogger("Memcache").info("更新删除缓存:"+string+" 失败！");
        }
    }
    
}
